using System.ComponentModel.DataAnnotations;

namespace UniversalAdmin.Application.Dtos.ArticleCategory;

/// <summary>
/// 创建文章分类的数据传输对象
/// </summary>
public class CreateArticleCategoryDto
{
    /// <summary>
    /// 分类名称
    /// </summary>
    [Required(ErrorMessage = "分类名称不能为空")]
    [StringLength(100, ErrorMessage = "分类名称长度不能超过100个字符")]
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 分类描述
    /// </summary>
    [StringLength(500, ErrorMessage = "分类描述长度不能超过500个字符")]
    public string? Description { get; set; }

    /// <summary>
    /// 父分类ID (null表示根分类)
    /// </summary>
    public Guid? ParentId { get; set; }

    /// <summary>
    /// 排序值 (数值越小排序越靠前)
    /// </summary>
    [Range(0, int.MaxValue, ErrorMessage = "排序值必须大于等于0")]
    public int Sort { get; set; } = 0;
}
